package fr.afcepf.iziticket.services;

import java.util.List;

import fr.afcepf.iziticket.beans.MainManagedBean;
import fr.afcepf.iziticket.dao.interfaces.DAOSpectacle;
import fr.afcepf.iziticket.entities.Spectacle;

public class TopSpectacleService {

	private static TopSpectacleService service;
	
	public void getSpectacles(List<Spectacle> spectacles){
		
		DAOSpectacle daoSpectacle = (DAOSpectacle) MainManagedBean.getContext().getBean("daoSpectacle");
		int[] liste = {1,2,4,5};
		for(int i=0; i<4; i++){
			Spectacle s = daoSpectacle.get(liste[i]);
			spectacles.add(s);
		}
		
	}

	private TopSpectacleService() {
	}
	
	public static TopSpectacleService getService(){
		if(service==null)
			service = new TopSpectacleService();
		return service;
	}
	
}
